import { postJsonRequest, getRequest,postRequest,getRequestWithNoToken, postRequestWithNoToken } from '@/libs/request';

// 文件上传接口
export const uploadFile = "/hboot/upload/file"
// 验证码渲染图片接口
export const drawCodeImage = "/hboot/common/captcha/draw/"
// 获取数据字典
export const getDictData = "/hboot/dictData/getByType/"
// Websocket
export const ws = "/hboot/ws"


// 登陆
export const login = (axios,params) => {
    return postRequest(axios,'/login', params)
}
// 获取用户登录信息
export const userInfo = (axios,params) => {
    return getRequest(axios,'/user/info', params)
}
// 注册
export const regist = (axios,params) => {
    return postRequest(axios,'/user/regist', params)
}
// 初始化验证码
export const initCaptcha = (axios,params) => {
    return getRequestWithNoToken(axios,'/common/captcha/init', params)
}
// 通过邮件重置密码
export const resetByEmail = (axios,params) => {
    return postRequest(axios,'/email/resetByEmail', params)
}

// 通过类型获取字典数据
export const getDictDataByType = (axios,type, params) => {
    return getRequest(axios,`/dictData/getByType/${type}`, params)
}

// base64上传
export const base64Upload = (axios,params) => {
    return postRequest(axios,'/upload/file', params)
}


